<style lang="less">
.resource {
}
</style>
<template>
<!-- <Tabs value="name1">
    <TabPane label="上传文件" name="name1">标签一的内容</TabPane>
    <TabPane label="资源库" name="name2"> -->
        <resource-core-ware 
            :ref="wareId"
            :is-only-folder="isOnlyFolder"
            :file-type="fileType"
            :show-type="showType"
            :operable="operable"
            :selectable="selectable"
            @on-select-change="handleOnSelectChange"
        ></resource-core-ware>
    <!-- </TabPane>
</Tabs> -->
</template>

<script lang="ts">
import ResourceCoreWare from './resource-core-ware';

export default {
    props: {
        isOnlyFolder: {
            type: Boolean,
            default: false
        },
        fileType: {
            type: Number,
            default: 0 // 0:all, 1:image, 2:document, 3:video
        },
        showType: {
            type: String,
            default: "thumbnail" // list, thumbnail
        },
        operable: {
            type: Boolean,
            default: true
        },
        selectable: {
            type: String,
            default: "all" // all, file, folder
        }
    },
    components: {
        ResourceCoreWare
    },
    data() {
        return {
            wareId: "resource-core-ware-" + Date.now(),
            theShowType: this.showType,
            theFileType: this.fileType,
        }
    },
    computed: {
    },
    methods: {
        getSelectedItems() {
            var temp = this.$refs[this.wareId];
            return temp ? temp.selectedItems : [];
        },
        clearSelect() {
            this.$refs[this.wareId].clearSelect();
        },
        handleOnSelectChange(items) {
            this.$emit('on-select-change', items);
        }
    },
    created() {
    }
}
</script>
